<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/6/26
  Time: 19:25
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
%>





    <div>${param.textName}  下的子类材质：</div>

<c:forEach items="${requestScope.childrenTextures}" var="c">
    <div data-id="${c.id}" class="garbageTexture" onclick="searchByChildrenTexture(this)" style="cursor:pointer;border:1px solid darkgrey;float: left;width: 20%;font-size: 15px;border-radius: 40px;text-align: center;margin-left: 20px;margin-top: 15px;" >
            ${c.title}
    </div>
</c:forEach>
<script src="<%=path%>/static/js/jquery-3.3.1.min.js"></script>
<script>

        //通过垃圾材质搜索文章
        function searchByChildrenTexture(obj){
            $(".garbageTexture").css("background-color","");//颜色全部变为无色
            $(obj).css("background-color","#FFFACD");//点击的变色
            textId = $(obj).data("id");
            textName = $(obj).data("name");
            pageNum=1;
            toAjax();
        }

</script>